﻿using System;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace WPF.Controls
{
    /// <summary>
    /// FButton.xaml 的交互逻辑
    /// </summary>

    public class ProgressBarValueConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double v = (double)value;

            string imageUri = "../Resources/Progress.png";

            if (v > 80)
            {
                imageUri = "../Resources/Progress.png";
            }
            else if (v > 50)
            {
                imageUri = "../Resources/Progress.png";
            }

            BitmapImage img = new BitmapImage(new Uri(imageUri, UriKind.Relative));

            return img;
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
